﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MCK_SchClass.ascx.cs" Inherits="ERP.Modules.MCK_SchClass" %>
<%-------------------------------%>
<ext:Hidden ID="FormatTypeMCK_SchClass" runat="server" />
<%--------------GridMCK_SchClass-----------------%>
<ext:Panel runat="server" Layout="Fit" Border="False" ID="PanelMCK_SchClass">
    <Content>
        <ext:GridPanel
            ID="grMCK_SchClass"
            runat="server"
            Cls="grid-double"
            EnableColumnMove="true"
            Border="False">
            <Store>
                <ext:Store
                    ID="StoreMCK_SchClass"
                    runat="server"
                    OnReadData="StoreMCK_SchClass_RefreshData"
                    PageSize="20">
                    <Model>
                        <ext:Model ID="ModelMCK_SchClass" runat="server" IDProperty="SchClass_ID">
                            <Fields>
                                <ext:ModelField Name="SchClass_Name" Type="String" />
                                <ext:ModelField Name="StartTime" Type="String" />
                                <ext:ModelField Name="EndTime" Type="String" />
                                <ext:ModelField Name="LateMinutes" Type="String" />
                                <ext:ModelField Name="EarlyMinutes" Type="String" />
                                <ext:ModelField Name="CheckInTime1" Type="String" />
                                <ext:ModelField Name="CheckInTime2" Type="String" />
                                <ext:ModelField Name="CheckOutTime1" Type="String" />
                                <ext:ModelField Name="CheckOutTime2" Type="String" />
                                <ext:ModelField Name="WorkMins" Type="String" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumn1" runat="server" Text="STT" Width="30" Align="Center" />
                    <ext:Column ID="Column1" runat="server" Text="Ca" Width="60" DataIndex="SchClass_Name"></ext:Column>
                    <ext:Column ID="Column2" runat="server" Text="Bắt đầu ngày làm việc" Width="125" DataIndex="StartTime"></ext:Column>
                    <ext:Column ID="Column4" runat="server" Text="Kết thúc ngày làm việc" Width="125" DataIndex="EndTime"></ext:Column>
                    <ext:Column ID="Column5" runat="server" Text="Đi trễ" Width="50" DataIndex="LateMinutes"></ext:Column>
                    <ext:Column ID="Column6" runat="server" Text="Về sớm" Width="50" DataIndex="EarlyMinutes"></ext:Column>
                    <ext:Column ID="Column7" runat="server" Text="Thời gian vào 1" Width="105" DataIndex="CheckInTime1"></ext:Column>
                    <ext:Column ID="Column8" runat="server" Text="Thời gian vào 2" Width="105" DataIndex="CheckInTime2"></ext:Column>
                    <ext:Column ID="Column9" runat="server" Text="Thời gian ra 1" Width="100" DataIndex="CheckOutTime1"></ext:Column>
                    <ext:Column ID="Column3" runat="server" Text="Thời gian ra 2" Width="100" DataIndex="CheckOutTime2"></ext:Column>
                    <ext:Column ID="Column10" runat="server" Text="Thời gian làm việc" Width="100" DataIndex="WorkMins" Flex="1"></ext:Column>
                </Columns>
            </ColumnModel>
            <DirectEvents>
                <ItemDblClick OnEvent="MCK_SchClassDblClick">
                    <ExtraParams>
                        <ext:Parameter Name="SchClass_ID" Value="record.data.SchClass_ID" Mode="Raw" />
                    </ExtraParams>
                    <EventMask ShowMask="true" Msg="Đang tải..." />
                </ItemDblClick>
            </DirectEvents>
            <SelectionModel>
                <ext:CheckboxSelectionModel ID="CheckboxSelectionModelMCK_SchClass" runat="server" Mode="Multi">
                    <Listeners>
                        <SelectionChange Handler="
                            if (selected.length == 0) {
                                #{btnEdit}.disable();
                                #{btnDel}.disable();
                                #{btnExport}.disable();
                            } else {
                                #{btnEdit}.enable();
                                #{btnDel}.enable();
                                #{btnExport}.enable();
                            }" />
                    </Listeners>
                </ext:CheckboxSelectionModel>
            </SelectionModel>
            <View>
                <ext:GridView ID="GridView1" runat="server" StripeRows="true" />
            </View>
            <DockedItems>
                <ext:Toolbar ID="ToolbarTopMain" runat="server" Dock="Top">
                    <Items>
                        <ext:Button ID="btnAddNew" runat="server" Text="Thêm mới" Icon="ApplicationAdd">
                            <DirectEvents>
                                <Click OnEvent="btnAddNew_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>

                        <ext:Button ID="btnEdit" runat="server" Text="Sửa" Icon="ApplicationEdit">
                            <DirectEvents>
                                <Click OnEvent="btnEdit_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>

                        <ext:Button ID="btnDel" runat="server" Text="Xoá" Icon="ApplicationDelete">
                            <DirectEvents>
                                <Click OnEvent="btnDel_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                    <ExtraParams>
                                        <ext:Parameter Name="name" Value="btnDel"></ext:Parameter>
                                    </ExtraParams>
                                    <Confirmation ConfirmRequest="true"
                                        Title="Thông Báo" Message="Bạn có muốn xoá mẫu tin này không ?">
                                    </Confirmation>
                                </Click>
                            </DirectEvents>
                        </ext:Button>

                        <ext:Button ID="btnExport" runat="server" Text="Xuất tập tin" Icon="Printer">
                            <Menu>
                                <ext:Menu ID="MenuMain" runat="server">
                                    <Items>
                                        <ext:MenuItem ID="MenuItemExportXML" runat="server" Text="XML" Icon="PageCode">
                                            <Listeners>
                                                <Click Handler="submitValue(#{grMCK_SchClass}, #{FormatTypeMCK_SchClass}, 'xml');" />
                                            </Listeners>
                                        </ext:MenuItem>
                                    </Items>
                                </ext:Menu>
                            </Menu>
                        </ext:Button>

                    </Items>
                </ext:Toolbar>
                <ext:Toolbar ID="ToolbarPagging" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                    <Items>
                        <ext:TriggerField ID="txtSearch" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                            <Triggers>
                                <ext:FieldTrigger Icon="Search" />
                            </Triggers>
                            <DirectEvents>
                                <TriggerClick OnEvent="Search_Event"></TriggerClick>
                            </DirectEvents>
                        </ext:TriggerField>
                        <ext:PagingToolbar ID="PagingToolbarMCK_SchClass" runat="server" StoreID="StoreMCK_SchClass" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                    </Items>
                </ext:Toolbar>
            </DockedItems>
        </ext:GridPanel>
    </Content>
</ext:Panel>
<ext:Panel ID="Panel1" runat="server">
    <Content>
        <%-----------WindowsMCK_SchClass-----------------%>
        <ext:Window ID="WindowsMCK_SchClass" runat="server"
            Title="Cập nhật giờ làm việc"
            Width="345"
            Frame="True"
            Hidden="true"
            Region="Center"
            Modal="true"
            HideMode="Display"
            Border="false"
            PaddingSummary="5px 5px 0"
            DefaultButton="btnSavePopUp"
            Resizable="False">
            <Items>
                <ext:Toolbar ID="ToolbarMCK_SchClass" runat="server">
                    <Items>
                        <ext:Button runat="server" Text="Lưu lại" Icon="Disk" ID="btnSavePopUp">
                            <DirectEvents>
                                <Click OnEvent="btnSavePopUp_Click" Before="return #{FormPanelMCK_SchClass}.isValid();">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:Button runat="server" Text="Huỷ bỏ" Icon="Decline" ID="btnCancelPopUp" OnClientClick="WindowsMCK_SchClass.hide();" />
                        <ext:TextField ID="txtSchClass_ID" runat="server" FieldLabel="ID" LabelAlign="Right" Hidden="true" />
                    </Items>
                </ext:Toolbar>
                <ext:FormPanel ID="FormPanelMCK_SchClass" runat="server"
                    AutoHeight="true"
                    Layout="HBox"
                    Border="False">
                    <Defaults>
                        <ext:Parameter Name="Border" Value="false" />
                        <ext:Parameter Name="Flex" Value="1" />
                        <ext:Parameter Name="Layout" Value="anchor" />
                    </Defaults>
                    <Items>
                        <ext:TabPanel runat="server">
                            <Items>
                                <ext:Panel runat="server" Title="Thông tin ca" Frame="True" Border="False" Padding="10">
                                    <Items>
                                        <ext:TextField ID="txtSchClass_Name" runat="server" LabelWidth="110" Width="310" FieldLabel="Ca" AllowBlank="false" />
                                        <ext:TimeField ID="txtStartTime" runat="server" LabelWidth="110" Width="310" FieldLabel="Thời gian bắt đầu" AllowBlank="false" MinTime="01:00" MaxTime="00:00" Increment="30" Format="HH:mm" />
                                        <ext:TimeField ID="txtEndTime" runat="server" LabelWidth="110" Width="310" FieldLabel="Thời gian kết thúc" AllowBlank="false" MinTime="01:00" MaxTime="00:00" Increment="30" Format="HH:mm" />
                                        <ext:NumberField ID="txtLateMinutes" runat="server" LabelWidth="110" Width="310" FieldLabel="Đi trễ" AllowBlank="false" MinValue="0" />
                                        <ext:NumberField ID="txtEarlyMinutes" runat="server" LabelWidth="110" Width="310" FieldLabel="Về sớm" AllowBlank="false" MinValue="0" />
                                        <ext:FieldContainer ID="FieldContainer1" runat="server" Layout="HBox" Width="310">
                                            <Items>
                                                <ext:Checkbox ID="ckCheckIn" runat="server" LabelWidth="110" FieldLabel="Kiểm tra vào" MarginSpec="0 50 0 0" />
                                                <ext:Checkbox ID="ckCheckOut" runat="server" LabelWidth="110" FieldLabel="Kiểm tra ra" />
                                            </Items>
                                        </ext:FieldContainer>
                                        <ext:TimeField ID="txtCheckInTime1" runat="server" LabelWidth="110" Width="310" FieldLabel="Thời gian vào 1" AllowBlank="false" MinTime="01:00" MaxTime="00:00" Increment="30" Format="HH:mm" />
                                        <ext:TimeField ID="txtCheckInTime2" runat="server" LabelWidth="110" Width="310" FieldLabel="Thời gian vào 2" AllowBlank="false" MinTime="01:00" MaxTime="00:00" Increment="30" Format="HH:mm" />
                                        <ext:TimeField ID="txtCheckOutTime1" runat="server" LabelWidth="110" Width="310" FieldLabel="Thời gian ra 1" AllowBlank="false" MinTime="01:00" MaxTime="00:00" Increment="30" Format="HH:mm" />
                                        <ext:TimeField ID="txtCheckOutTime2" runat="server" LabelWidth="110" Width="310" FieldLabel="Thời gian ra 2" AllowBlank="false" MinTime="01:00" MaxTime="00:00" Increment="30" Format="HH:mm" />
                                        <ext:NumberField ID="txtWorkDay" runat="server" LabelWidth="110" Width="310" FieldLabel="Ngày làm việc" AllowBlank="false" MinValue="0" />
                                        <ext:NumberField ID="txtWorkMins" runat="server" LabelWidth="110" Width="310" FieldLabel="Thời gian làm việc" AllowBlank="false" MinValue="0" />
                                    </Items>
                                </ext:Panel>
                                <ext:Panel runat="server" Title="Ngày cuối tuần" Frame="True" Border="False" Padding="10">
                                    <Items>
                                        <ext:Checkbox runat="server" ID="ckDay2" FieldLabel="Thứ 2" />
                                        <ext:Checkbox runat="server" ID="ckDay3" FieldLabel="Thứ 3" />
                                        <ext:Checkbox runat="server" ID="ckDay4" FieldLabel="Thứ 4" />
                                        <ext:Checkbox runat="server" ID="ckDay5" FieldLabel="Thứ 5" />
                                        <ext:Checkbox runat="server" ID="ckDay6" FieldLabel="Thứ 6" />
                                        <ext:Checkbox runat="server" ID="ckDay7" FieldLabel="Thứ 7" />
                                        <ext:Checkbox runat="server" ID="ckDay1" FieldLabel="Chủ nhật" />
                                    </Items>
                                </ext:Panel>
                            </Items>
                        </ext:TabPanel>
                    </Items>
                </ext:FormPanel>
            </Items>
        </ext:Window>
    </Content>
</ext:Panel>
